package com.lyd.collections.list;

import com.lyd.basic.Person;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

/**
 * @Author:lyd
 **/
public class ListTest {
    public static void main(String[] args) {
        Person person =null;
        List<Person> people = new ArrayList<>();
        people.add(person);
        List<Person> graphVoList = Optional.ofNullable(people)
                .orElse(Collections.emptyList());
        System.out.println(graphVoList);
        System.out.println(graphVoList.size());

        for (Person p : graphVoList) {
            System.out.println(p);
        }

    }

}
